package com.prs.crm.dao.crm.impl;

import java.util.Collection;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.crm.CityDao;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.domain.crm.City;
import com.prs.crm.domain.crm.Province;

public class CityDaoImpl extends BaseDaoImpl<City> implements CityDao {

	@Override
	public Collection<City> getCityByProvince(Province province) {
		Criteria criteria = this.getSession().createCriteria(City.class);
		criteria.add(Restrictions.eq("province", province));
		return criteria.list();
	}

}
